package cn.ittaoli.tlzhuanzhuan.controller;

import cn.ittaoli.tlzhuanzhuan.model.Result;
import cn.ittaoli.tlzhuanzhuan.model.User;
import cn.ittaoli.tlzhuanzhuan.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;


@RestController
@RequestMapping("/index")
public class IndexController {
    @Autowired
    private IndexService indexService;

    @RequestMapping("/index")
    public String index(){
        return "hello world";
    }

    @RequestMapping("/login")
    public Result<User> login(String username,String password){
        return indexService.login(username,password);
    }


    @RequestMapping("/uploadHead")
    public Result<User> uploadHead(MultipartFile file,Integer id){
        return indexService.uploadHead(file,id);



    }
}
